package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.ItemParam;
import cn.wolfcode.trip.base.mapper.ItemParamMapper;
import cn.wolfcode.trip.base.service.IItemParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemParamServiceImpl implements IItemParamService {
    @Autowired
    private ItemParamMapper itemParamMapper;

    @Override
    public void save(ItemParam itemParam) {
        itemParamMapper.insert(itemParam);
    }

    @Override
    public void delete(Long id) {
        itemParamMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<ItemParam> selectAll() {
        return itemParamMapper.selectAll();
    }

    @Override
    public List<ItemParam> getParamsByTypeId(Long itemId) {
        return itemParamMapper.selectParamsByTypeId(itemId);
    }

    @Override
    public void update(ItemParam itemParam) {
        itemParamMapper.updateByPrimaryKey(itemParam);
    }

    @Override
    public ItemParam get(Long id) {
        return itemParamMapper.selectByPrimaryKey(id);
    }

}
